import { Component, Input, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { NavInfoData, navInfos } from 'src/app/modules/nav/nav-infos';
import { CommonService } from 'src/app/service/common/common.service';

interface NavData {
  code: string,
  name: string,
  router: string
}

@Component({
  selector: 'app-the-nav',
  templateUrl: './the-nav.component.html',
  styleUrls: ['./the-nav.component.scss']
})
export class TheNavComponent implements OnInit {

  constructor(
    private router: Router,
    private commonService: CommonService
  ) { }

  ngOnInit(): void {
  }

  navData: NavInfoData[] = navInfos

  goNav(nav: NavInfoData){
    this.commonService.isHome.next(false)
    this.router.navigate([nav.router])
  }

}
